Package-level declarations

This is the main package for the Viaduct Tenant API, containing the core interfaces and classes that tenants will use to implement their GraphQL schema behavior.

Types

Link copied to clipboard
sealed interface FieldValue<out T>

Represents the value of a resolved GraphQL object field

Link copied to clipboard

Base interface for node resolver classes

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class Resolver(val objectValueFragment: String = "", val queryValueFragment: String = "", val variables: Array<Variable> = [])

Annotation to mark a class as a resolver for a field or object in a GraphQL schema which requires custom resolution logic rather than simple property access.

Link copied to clipboard
interface ResolverBase<T>

Base interface for field resolver classes

Link copied to clipboard
interface TenantModule
Link copied to clipboard
annotation class Variable(val name: String, val fromObjectField: String = UNSET_STRING_VALUE, val fromQueryField: String = UNSET_STRING_VALUE, val fromArgument: String = UNSET_STRING_VALUE)
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class Variables(val types: String)
Link copied to clipboard
fun interface VariablesProvider<A : Arguments>

A base interface for dynamic provisioning of variable values. All implementations of VariablesProvider must be annotated with Variables.

Functions

Link copied to clipboard
inline suspend fun <T> fetchOrDefault(default: T, block: suspend () -> T): T

Executes the given block and returns its result, or default if an exception is thrown.

Link copied to clipboard
inline suspend fun <T> fetchOrNull(block: suspend () -> T): T?

Executes the given block and returns its result, or null if an exception is thrown.